package edu.nakan.employee;

/**
 * @author PHUNG Nam Can - NakanPhung
 * @mail cank56hua@gmail.com
 * @date Jul 23, 2013 11:10:58 AM
 * @project HomeWorkDay4Problem2
 * @file Employee.java
 */

public class Employee {

	private static final float PAY_COMMON = 1.5f;

	// To setup variable
	private String id = "";
	private String name = "";
	private String date = "";
	private float pay = 0.0f;

	public Employee(String id, String name, String date, float pay) {

		this.id = id;
		this.name = name;
		this.date = date;
		this.pay = pay;
	}

	public static float calculatePay(float pay) {

		// pay after to time with PAY_COMMON
		pay = pay * PAY_COMMON;
		return pay;

	}

	public void display() {

		System.out.println(id + "\t\t\t" + name + "\t\t\t" + date + "\t\t\t"
				+ calculatePay(pay));

	}

	public String toString() {
		return id + "\t\t\t" + name + "\t\t\t" + date + "\t\t\t"
				+ calculatePay(pay);
	}

	public boolean equals(Employee employee) {
		if (employee != null && employee.id == this.id
				&& employee.name.equals(this.name)) {
			return true;
		} else {
			return false;
		}
	}

}
